package com.wlxk.boot.starter.swagger;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author wlxk
 * @since 2021-10-27 14:09:05
 */
@Data
@ConfigurationProperties(prefix = "swagger")
public class SwaggerProperties {

    /**
     * 是否启用 swagger 3
     */
    private boolean enabled = true;

    /**
     * 接口文档页面配置
     */
    private SwaggerUi ui = SwaggerUi.DEFAULT;

    @Data
    @NoArgsConstructor
    public static class SwaggerUi {
        public static final SwaggerUi DEFAULT = new SwaggerUi("");

        /**
         * 是否启用 swagger ui
         */
        private boolean enabled = true;

        /**
         * 接口文档页面的基础路径
         */
        private String baseUrl;

        public SwaggerUi(String baseUrl) {
            this.baseUrl = baseUrl;
        }
    }
}
